import { defHttp } from "/@/utils/http/axios"
import { Modal } from "ant-design-vue"

enum Api {
  list = "/member-service/member/level/list",
  get = "/member-service/member/level/get",
  save = "/member-service/member/level/save",
  update = "/member-service/member/level/update",
  delete = "/member-service/member/level/delete",
}

export const listMemberLevel = (params) => {
  return defHttp.get({ url: Api.list, params })
}

export const saveOrUpdateLevel = (params, isUpdate) => {
  const url = isUpdate ? Api.update : Api.save
  return defHttp.post({ url: url, params })
}

export const getLevelDetails = (params) => {
  return defHttp.get({ url: Api.get, params })
}

export const deleteLevel = (params, handleSuccess) => {
  return defHttp.delete({ url: Api.delete, params }, { joinParamsToUrl: true }).then(() => {
    handleSuccess()
  })
}
